﻿using Dynamic.Api.TestService.Model;
using Dynamic.Utils;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;

namespace Dynamic.Api.MyService
{

    /// <summary>
    /// EmployerManager自动API控制器
    /// </summary>
    [Service("EmployerManager")]
    public class EmployerManagerService : IDynamicWebApi
    {
        private static List<Employee> employees = new List<Employee>();
        /// <summary>
        /// 
        /// </summary>
        public EmployerManagerService()
        {
            employees.Add(new Employee("1001", "总裁"));
            employees.Add(new Employee("1002", "总经理"));
        }

        /// <summary>
        /// 用户列表
        /// </summary>
        /// <returns></returns>
        [HttpGet("list")]
        [AllowAnonymous]
        public async Task<List<Employee>> GetAll()
        {
            return await Task.FromResult(employees);
        }


    }
}
